#pragma once

#include "ui.h"
#include "ui_base.h"

_SSL_BEGIN
_SSUIL_BEGIN

#pragma warning(push)
#pragma warning(disable:4250)

class UIXmlRapidDocument :
	public IUIXMLDocumentInterface,
	virtual public ref_counted_base
{
public:
	UIXmlRapidDocument();
	virtual ~UIXmlRapidDocument();

	// IUIXMLDocumentInterface
public:
	//
	virtual bool Parse(const char *xml_utf8);
	virtual void Clear();

	//
	virtual UIXmlNode FirstNode(const char *name);
	virtual UIXmlNode NextSiblingNode(const char *name);
	virtual UIXmlNode FirstNode(UIXmlNode node, const char *name);
	virtual UIXmlNode NextSiblingNode(UIXmlNode node, const char *name);

	virtual const char * NodeName(UIXmlNode node);
	virtual void NodeName(UIXmlNode node, const char *new_name);
	virtual const char *NodeValue(UIXmlNode node);
	virtual void NodeValue(UIXmlNode node, const char *new_value);

	//
	virtual UIXmlAttribute FirstAttribute(UIXmlNode node, const char *name);

	virtual const char * AttributeName(UIXmlAttribute attri_node);
	virtual void AttributeName(UIXmlAttribute attri_node, const char *new_name);
	virtual const char *AttributeValue(UIXmlAttribute attri_node);
	virtual void AttributeValue(UIXmlAttribute attri_node, const char *new_value);

protected:
	char *xml_buffer_;
	void *xml_document_parser_;
};

#pragma warning(pop)

_SSUIL_END
_SSL_END
